const express = require('express');
const expressWs = require('express-ws');
const websocket = require('./websocket');
const app = express();
const port = 8080;
expressWs(app);

//中间件
app.use(express.static('public'));
app.use('/libai',express.static('public/libai.html'));
app.use('/dufu',express.static('public/dufu.html'));
app.use('/ws',websocket);
app.get('/*',(req,res)=>{});
app.listen(port,()=>{
    console.log(`Server is running at ws://localhost:${port}`)
})